home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Controls.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  24KB  |  688 lines

  1. /*
  2.      File:        Controls.h
  3.  
  4.      Contains:    Control Manager interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __CONTROLS__
  19. #define __CONTROLS__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __MENUS__
  28. #include <Menus.h>
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT_SUPPORTED
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_ALIGN_SUPPORTED
  40. #pragma options align=mac68k
  41. #endif
  42.  
  43. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  44. /*
  45. _________________________________________________________________________________________________________
  46.  * CONTROL DEFINITION ID'S
  47. _________________________________________________________________________________________________________
  48.  Standard System 7 procID's
  49. */
  50.  
  51. enum {
  52.     pushButProc                    = 0,
  53.     checkBoxProc                = 1,
  54.     radioButProc                = 2,
  55.     scrollBarProc                = 16,
  56.     popupMenuProc                = 1008
  57. };
  58.  
  59. /*
  60. _________________________________________________________________________________________________________
  61.  * VARIANT CODES
  62. _________________________________________________________________________________________________________
  63. */
  64. typedef SInt16 ControlVariant;
  65.  
  66. enum {
  67.     kControlNoVariant            = 0,                            /* No variant*/
  68.     kControlUsesOwningWindowsFontVariant = 1 << 3                /* Control uses owning windows font to display text*/
  69. };
  70.  
  71. /*
  72. _________________________________________________________________________________________________________
  73.  * CONTROL PART CODES
  74. _________________________________________________________________________________________________________
  75. */
  76. typedef SInt16 ControlPartCode;
  77.  
  78. enum {
  79.     kControlNoPart                = 0,
  80.     kControlLabelPart            = 1,
  81.     kControlMenuPart            = 2,
  82.     kControlTrianglePart        = 4,
  83.     kControlButtonPart            = 10,
  84.     kControlCheckBoxPart        = 11,
  85.     kControlRadioButtonPart        = 11,
  86.     kControlUpButtonPart        = 20,
  87.     kControlDownButtonPart        = 21,
  88.     kControlPageUpPart            = 22,
  89.     kControlPageDownPart        = 23,
  90.     kControlIndicatorPart        = 129,
  91.     kControlDisabledPart        = 254,
  92.     kControlInactivePart        = 255
  93. };
  94.  
  95. /*
  96. _________________________________________________________________________________________________________
  97.  * CHECK BOX VALUES
  98. _________________________________________________________________________________________________________
  99. */
  100.  
  101. enum {
  102.     kControlCheckBoxUncheckedValue = 0,
  103.     kControlCheckBoxCheckedValue = 1,
  104.     kControlCheckBoxMixedValue    = 2
  105. };
  106.  
  107. /*
  108. _________________________________________________________________________________________________________
  109.  * RADIO BUTTON VALUES
  110. _________________________________________________________________________________________________________
  111. */
  112.  
  113. enum {
  114.     kControlRadioButtonUncheckedValue = 0,
  115.     kControlRadioButtonCheckedValue = 1,
  116.     kControlRadioButtonMixedValue = 2
  117. };
  118.  
  119. /*
  120. _________________________________________________________________________________________________________
  121.  
  122.  * CONTROL POP-UP MENU CONSTANTS
  123. _________________________________________________________________________________________________________
  124.  Variant codes for the System 7 pop-up menu
  125. */
  126.  
  127. enum {
  128.     popupFixedWidth                = 1 << 0,
  129.     popupVariableWidth            = 1 << 1,
  130.     popupUseAddResMenu            = 1 << 2,
  131.     popupUseWFont                = 1 << 3
  132. };
  133.  
  134. /* Menu label styles for the System 7 pop-up menu */
  135.  
  136. enum {
  137.     popupTitleBold                = 1 << 8,
  138.     popupTitleItalic            = 1 << 9,
  139.     popupTitleUnderline            = 1 << 10,
  140.     popupTitleOutline            = 1 << 11,
  141.     popupTitleShadow            = 1 << 12,
  142.     popupTitleCondense            = 1 << 13,
  143.     popupTitleExtend            = 1 << 14,
  144.     popupTitleNoStyle            = 1 << 15
  145. };
  146.  
  147. /* Menu label justifications for the System 7 pop-up menu*/
  148.  
  149. enum {
  150.     popupTitleLeftJust            = 0x00000000,
  151.     popupTitleCenterJust        = 0x00000001,
  152.     popupTitleRightJust            = 0x000000FF
  153. };
  154.  
  155. /*
  156. _________________________________________________________________________________________________________
  157.  * CONTROL DRAGGRAYRGN CONSTANTS
  158.    For DragGrayRgnUPP used in TrackControl() 
  159. _________________________________________________________________________________________________________
  160. */
  161.  
  162. enum {
  163.     noConstraint                = kNoConstraint,
  164.     hAxisOnly                    = 1,
  165.     vAxisOnly                    = 2
  166. };
  167.  
  168. /*
  169. _________________________________________________________________________________________________________
  170.  * CONTROL COLOR TABLE PART CODES
  171. _________________________________________________________________________________________________________
  172. */
  173.  
  174. enum {
  175.     cFrameColor                    = 0,
  176.     cBodyColor                    = 1,
  177.     cTextColor                    = 2,
  178.     cThumbColor                    = 3,
  179.     kNumberCtlCTabEntries        = 4
  180. };
  181.  
  182. /*
  183. _________________________________________________________________________________________________________
  184.  * CONTROLHANDLE & CONTROLREF
  185. _________________________________________________________________________________________________________
  186. */
  187. typedef struct ControlRecord ControlRecord;
  188. typedef ControlRecord *ControlPtr;
  189. typedef ControlPtr *ControlHandle;
  190. typedef ControlHandle ControlRef;
  191. /*
  192. _________________________________________________________________________________________________________
  193.  * CONTROL ACTIONPROC POINTER
  194. _________________________________________________________________________________________________________
  195. */
  196. typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl, ControlPartCode partCode);
  197.  
  198. #if GENERATINGCFM
  199. typedef UniversalProcPtr ControlActionUPP;
  200. #else
  201. typedef ControlActionProcPtr ControlActionUPP;
  202. #endif
  203. /*
  204. _________________________________________________________________________________________________________
  205.  * CONTROL COLOR TABLE
  206. _________________________________________________________________________________________________________
  207. */
  208. struct CtlCTab {
  209.     SInt32                             ccSeed;
  210.     SInt16                             ccRider;
  211.     SInt16                             ctSize;
  212.     ColorSpec                         ctTable[4];
  213. };
  214. typedef struct CtlCTab CtlCTab;
  215.  
  216. typedef CtlCTab *CCTabPtr;
  217. typedef CCTabPtr *CCTabHandle;
  218. /*
  219. _________________________________________________________________________________________________________
  220.  * CONTROL RECORD
  221. _________________________________________________________________________________________________________
  222. */
  223. struct ControlRecord {
  224.     ControlHandle                     nextControl;
  225.     WindowPtr                         contrlOwner;
  226.     Rect                             contrlRect;
  227.     UInt8                             contrlVis;
  228.     UInt8                             contrlHilite;
  229.     SInt16                             contrlValue;
  230.     SInt16                             contrlMin;
  231.     SInt16                             contrlMax;
  232.     Handle                             contrlDefProc;
  233.     Handle                             contrlData;
  234.     ControlActionUPP                 contrlAction;
  235.     SInt32                             contrlRfCon;
  236.     Str255                             contrlTitle;
  237. };
  238.  
  239. /*
  240. _________________________________________________________________________________________________________
  241.  * AUXILLARY CONTROL RECORD STRUCTURE
  242. _________________________________________________________________________________________________________
  243. */
  244. struct AuxCtlRec {
  245.     Handle                             acNext;
  246.     ControlHandle                     acOwner;
  247.     CCTabHandle                     acCTable;
  248.     SInt16                             acFlags;
  249.     SInt32                             acReserved;
  250.     SInt32                             acRefCon;
  251. };
  252. typedef struct AuxCtlRec AuxCtlRec;
  253.  
  254. typedef AuxCtlRec *AuxCtlPtr;
  255. typedef AuxCtlPtr *AuxCtlHandle;
  256. /*
  257. _________________________________________________________________________________________________________
  258.  * POP-UP MENU PRIVATE DATA STRUCTURE
  259. _________________________________________________________________________________________________________
  260. */
  261. struct PopupPrivateData {
  262.     MenuHandle                         mHandle;
  263.     SInt16                             mID;
  264. };
  265. typedef struct PopupPrivateData PopupPrivateData;
  266.  
  267. typedef PopupPrivateData *PopupPrivateDataPtr;
  268. typedef PopupPrivateDataPtr *PopupPrivateDataHandle;
  269. /*
  270. _________________________________________________________________________________________________________
  271.  * CONTROL ACTION PROC UPP'S
  272. _________________________________________________________________________________________________________
  273. */
  274.  
  275. #if GENERATINGCFM
  276. #else
  277. #endif
  278.  
  279. enum {
  280.     uppControlActionProcInfo = kPascalStackBased
  281.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  282.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlPartCode)))
  283. };
  284.  
  285. #if GENERATINGCFM
  286. #define NewControlActionProc(userRoutine)        \
  287.         (ControlActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, GetCurrentArchitecture())
  288. #else
  289. #define NewControlActionProc(userRoutine)        \
  290.         ((ControlActionUPP) (userRoutine))
  291. #endif
  292.  
  293. #if GENERATINGCFM
  294. #define CallControlActionProc(userRoutine, theControl, partCode)        \
  295.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlActionProcInfo, (theControl), (partCode))
  296. #else
  297. #define CallControlActionProc(userRoutine, theControl, partCode)        \
  298.         (*(userRoutine))((theControl), (partCode))
  299. #endif
  300. /*
  301. _________________________________________________________________________________________________________
  302.     
  303.  * CONTROL CREATION / DELETION API'S
  304. _________________________________________________________________________________________________________
  305. */
  306. extern pascal ControlHandle NewControl(WindowPtr owningWindow, const Rect *boundsRect, ConstStr255Param controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference)
  307.  ONEWORDINLINE(0xA954);
  308.  
  309. extern pascal ControlHandle GetNewControl(SInt16 resourceID, WindowPtr owningWindow)
  310.  ONEWORDINLINE(0xA9BE);
  311.  
  312. extern pascal void DisposeControl(ControlHandle theControl)
  313.  ONEWORDINLINE(0xA955);
  314.  
  315. extern pascal void KillControls(WindowPtr theWindow)
  316.  ONEWORDINLINE(0xA956);
  317.  
  318. /*
  319. _________________________________________________________________________________________________________
  320.     
  321.  * CONTROL SHOWING/HIDING API'S
  322. _________________________________________________________________________________________________________
  323. */
  324. extern pascal void ShowControl(ControlHandle theControl)
  325.  ONEWORDINLINE(0xA957);
  326.  
  327. extern pascal void HideControl(ControlHandle theControl)
  328.  ONEWORDINLINE(0xA958);
  329.  
  330. /*
  331. _________________________________________________________________________________________________________
  332.     
  333.  * CONTROL DRAWING API'S
  334. _________________________________________________________________________________________________________
  335. */
  336. extern pascal void DrawControls(WindowPtr theWindow)
  337.  ONEWORDINLINE(0xA969);
  338.  
  339. extern pascal void Draw1Control(ControlHandle theControl)
  340.  ONEWORDINLINE(0xA96D);
  341.  
  342. #define DrawOneControl(theControl) Draw1Control(theControl)
  343. extern pascal void UpdateControls(WindowPtr theWindow, RgnHandle updateRegion)
  344.  ONEWORDINLINE(0xA953);
  345.  
  346. /*
  347. _________________________________________________________________________________________________________
  348.     
  349.  * CONTROL HIGHLIGHT API'S
  350. _________________________________________________________________________________________________________
  351. */
  352. extern pascal void HiliteControl(ControlHandle theControl, ControlPartCode hiliteState)
  353.  ONEWORDINLINE(0xA95D);
  354.  
  355. /*
  356. _________________________________________________________________________________________________________
  357.     
  358.  * CONTROL TRACKING/DRAGGING API'S
  359. _________________________________________________________________________________________________________
  360.     When using the TrackControl() call when tracking an indicator, the actionProc parameter (type ControlActionUPP) 
  361.   should be replaced by a parameter of type DragGrayRgnUPP (see Quickdraw.h).
  362. */
  363. extern pascal ControlPartCode TrackControl(ControlHandle theControl, Point startPoint, ControlActionUPP actionProc)
  364.  ONEWORDINLINE(0xA968);
  365.  
  366. extern pascal void DragControl(ControlHandle theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis)
  367.  ONEWORDINLINE(0xA967);
  368.  
  369. extern pascal ControlPartCode TestControl(ControlHandle theControl, Point testPoint)
  370.  ONEWORDINLINE(0xA966);
  371.  
  372. extern pascal ControlPartCode FindControl(Point testPoint, WindowPtr theWindow, ControlHandle *theControl)
  373.  ONEWORDINLINE(0xA96C);
  374.  
  375. /*
  376. _________________________________________________________________________________________________________
  377.     
  378.  * CONTROL MOVING/SIZING API'S
  379. _________________________________________________________________________________________________________
  380. */
  381. extern pascal void MoveControl(ControlHandle theControl, SInt16 h, SInt16 v)
  382.  ONEWORDINLINE(0xA959);
  383.  
  384. extern pascal void SizeControl(ControlHandle theControl, SInt16 w, SInt16 h)
  385.  ONEWORDINLINE(0xA95C);
  386.  
  387. /*
  388. _________________________________________________________________________________________________________
  389.     
  390.  * CONTROL TITLE API'S
  391. _________________________________________________________________________________________________________
  392. */
  393. extern pascal void SetControlTitle(ControlHandle theControl, ConstStr255Param title)
  394.  ONEWORDINLINE(0xA95F);
  395.  
  396. extern pascal void GetControlTitle(ControlHandle theControl, Str255 title)
  397.  ONEWORDINLINE(0xA95E);
  398.  
  399. /*
  400. _________________________________________________________________________________________________________
  401.     
  402.  * CONTROL VALUE, MIMIMUM, AND MAXIMUM API'S
  403. _________________________________________________________________________________________________________
  404. */
  405. extern pascal SInt16 GetControlValue(ControlHandle theControl)
  406.  ONEWORDINLINE(0xA960);
  407.  
  408. extern pascal void SetControlValue(ControlHandle theControl, SInt16 newValue)
  409.  ONEWORDINLINE(0xA963);
  410.  
  411. extern pascal SInt16 GetControlMinimum(ControlHandle theControl)
  412.  ONEWORDINLINE(0xA961);
  413.  
  414. extern pascal void SetControlMinimum(ControlHandle theControl, SInt16 newMinimum)
  415.  ONEWORDINLINE(0xA964);
  416.  
  417. extern pascal SInt16 GetControlMaximum(ControlHandle theControl)
  418.  ONEWORDINLINE(0xA962);
  419.  
  420. extern pascal void SetControlMaximum(ControlHandle theControl, SInt16 newMaximum)
  421.  ONEWORDINLINE(0xA965);
  422.  
  423. /*
  424. _________________________________________________________________________________________________________
  425.     
  426.  * CONTROL VARIANT AND WINDOW INFORMATION API'S
  427. _________________________________________________________________________________________________________
  428. */
  429. extern pascal ControlVariant GetControlVariant(ControlHandle theControl)
  430.  ONEWORDINLINE(0xA809);
  431.  
  432. /*
  433. _________________________________________________________________________________________________________
  434.     
  435.  * CONTROL ACTION PROC API'S
  436. _________________________________________________________________________________________________________
  437. */
  438. extern pascal void SetControlAction(ControlHandle theControl, ControlActionUPP actionProc)
  439.  ONEWORDINLINE(0xA96B);
  440.  
  441. extern pascal ControlActionUPP GetControlAction(ControlHandle theControl)
  442.  ONEWORDINLINE(0xA96A);
  443.  
  444. /*
  445. _________________________________________________________________________________________________________
  446.     
  447.  * CONTROL ACCESSOR API'S
  448. _________________________________________________________________________________________________________
  449. */
  450. extern pascal void SetControlReference(ControlHandle theControl, SInt32 data)
  451.  ONEWORDINLINE(0xA95B);
  452.  
  453. extern pascal SInt32 GetControlReference(ControlHandle theControl)
  454.  ONEWORDINLINE(0xA95A);
  455.  
  456. extern pascal Boolean GetAuxiliaryControlRecord(ControlHandle theControl, AuxCtlHandle *acHndl)
  457.  ONEWORDINLINE(0xAA44);
  458.  
  459. extern pascal void SetControlColor(ControlHandle theControl, CCTabHandle newColorTable)
  460.  ONEWORDINLINE(0xAA43);
  461.  
  462. /*
  463. _________________________________________________________________________________________________________
  464.     
  465.  * VALID 'CDEF' MESSAGES
  466. _________________________________________________________________________________________________________
  467. */
  468. typedef SInt16 ControlDefProcMessage;
  469.  
  470. enum {
  471.     drawCntl                    = 0,
  472.     testCntl                    = 1,
  473.     calcCRgns                    = 2,
  474.     initCntl                    = 3,
  475.     dispCntl                    = 4,
  476.     posCntl                        = 5,
  477.     thumbCntl                    = 6,
  478.     dragCntl                    = 7,
  479.     autoTrack                    = 8,
  480.     calcCntlRgn                    = 10,
  481.     calcThumbRgn                = 11,
  482.     drawThumbOutline            = 12
  483. };
  484.  
  485. /*
  486. _________________________________________________________________________________________________________
  487.     
  488.  * MAIN ENTRY POINT FOR 'CDEF'
  489. _________________________________________________________________________________________________________
  490. */
  491. typedef pascal SInt32 (*ControlDefProcPtr)(SInt16 varCode, ControlHandle theControl, ControlDefProcMessage message, SInt32 param);
  492.  
  493. #if GENERATINGCFM
  494. typedef UniversalProcPtr ControlDefUPP;
  495. #else
  496. typedef ControlDefProcPtr ControlDefUPP;
  497. #endif
  498.  
  499. enum {
  500.     uppControlDefProcInfo = kPascalStackBased
  501.          | RESULT_SIZE(SIZE_CODE(sizeof(SInt32)))
  502.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SInt16)))
  503.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlHandle)))
  504.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ControlDefProcMessage)))
  505.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(SInt32)))
  506. };
  507.  
  508. #if GENERATINGCFM
  509. #define NewControlDefProc(userRoutine)        \
  510.         (ControlDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentArchitecture())
  511. #else
  512. #define NewControlDefProc(userRoutine)        \
  513.         ((ControlDefUPP) (userRoutine))
  514. #endif
  515.  
  516. #if GENERATINGCFM
  517. #define CallControlDefProc(userRoutine, varCode, theControl, message, param)        \
  518.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlDefProcInfo, (varCode), (theControl), (message), (param))
  519. #else
  520. #define CallControlDefProc(userRoutine, varCode, theControl, message, param)        \
  521.         (*(userRoutine))((varCode), (theControl), (message), (param))
  522. #endif
  523. /*
  524. _________________________________________________________________________________________________________
  525.     
  526.  * CONSTANTS FOR DRAWCNTL MESSAGE PASSED IN PARAM
  527. _________________________________________________________________________________________________________
  528. */
  529.  
  530. enum {
  531.     kDrawControlEntireControl    = 0,
  532.     kDrawControlIndicatorOnly    = 129
  533. };
  534.  
  535. /*
  536. _________________________________________________________________________________________________________
  537.     
  538.  * CONSTANTS FOR DRAGCNTL MESSAGE PASSED IN PARAM
  539. _________________________________________________________________________________________________________
  540. */
  541.  
  542. enum {
  543.     kDragControlEntireControl    = 0,
  544.     kDragControlIndicator        = 1
  545. };
  546.  
  547. /*
  548. _________________________________________________________________________________________________________
  549.     
  550.  * DRAG CONSTRAINT STRUCTURE PASSED IN PARAM FOR THUMBCNTL MESSAGE (IM I-332)
  551. _________________________________________________________________________________________________________
  552. */
  553. struct IndicatorDragConstraint {
  554.     Rect                             limitRect;
  555.     Rect                             slopRect;
  556.     DragConstraint                     axis;
  557. };
  558. typedef struct IndicatorDragConstraint IndicatorDragConstraint;
  559.  
  560. typedef IndicatorDragConstraint *IndicatorDragConstraintPtr;
  561. typedef IndicatorDragConstraintPtr *IndicatorDragConstraintHandle;
  562. /*
  563. _________________________________________________________________________________________________________
  564.  * C GLUE
  565. _________________________________________________________________________________________________________
  566. */
  567. extern void dragcontrol(ControlHandle theControl, Point *startPt, const Rect *limitRect, const Rect *slopRect, short axis);
  568.  
  569. extern ControlHandle newcontrol(WindowPtr theWindow, const Rect *boundsRect, const char *title, Boolean visible, short value, short min, short max, short procID, long refCon);
  570.  
  571. extern short findcontrol(Point *thePoint, WindowPtr theWindow, ControlHandle *theControl);
  572.  
  573. extern void getcontroltitle(ControlHandle theControl, char *title);
  574.  
  575. extern void setcontroltitle(ControlHandle theControl, const char *title);
  576.  
  577. extern short trackcontrol(ControlHandle theControl, Point *thePoint, ControlActionUPP actionProc);
  578.  
  579. extern short testcontrol(ControlHandle theControl, Point *thePt);
  580.  
  581. #if OLDROUTINENAMES
  582. /*
  583. _________________________________________________________________________________________________________
  584.  * OLDROUTINENAMES
  585. _________________________________________________________________________________________________________
  586.  Variants applicable to all controls (at least ones with text)
  587. */
  588.  
  589. enum {
  590.     useWFont                    = 8
  591. };
  592.  
  593.  
  594. enum {
  595.     inLabel                        = 1,
  596.     inMenu                        = 2,
  597.     inTriangle                    = 4,
  598.     inButton                    = 10,
  599.     inCheckBox                    = 11,
  600.     inUpButton                    = 20,
  601.     inDownButton                = 21,
  602.     inPageUp                    = 22,
  603.     inPageDown                    = 23,
  604.     inThumb                        = 129
  605. };
  606.  
  607.  
  608. enum {
  609.     kNoHiliteControlPart        = 0,
  610.     kInLabelControlPart            = 1,
  611.     kInMenuControlPart            = 2,
  612.     kInTriangleControlPart        = 4,
  613.     kInButtonControlPart        = 10,
  614.     kInCheckBoxControlPart        = 11,
  615.     kInUpButtonControlPart        = 20,
  616.     kInDownButtonControlPart    = 21,
  617.     kInPageUpControlPart        = 22,
  618.     kInPageDownControlPart        = 23,
  619.     kInIndicatorControlPart        = 129,
  620.     kReservedControlPart        = 254,
  621.     kControlInactiveControlPart    = 255
  622. };
  623.  
  624. #define SetCTitle(theControl, title) SetControlTitle(theControl, title)
  625. #define GetCTitle(theControl, title) GetControlTitle(theControl, title)
  626. #define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn)
  627. #define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue)
  628. #define GetCtlValue(theControl) GetControlValue(theControl)
  629. #define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue)
  630. #define GetCtlMin(theControl) GetControlMinimum(theControl)
  631. #define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue)
  632. #define GetCtlMax(theControl) GetControlMaximum(theControl)
  633. #define GetAuxCtl(theControl, acHndl) GetAuxiliaryControlRecord(theControl, acHndl)
  634. #define SetCRefCon(theControl, data) SetControlReference(theControl, data)
  635. #define GetCRefCon(theControl) GetControlReference(theControl)
  636. #define SetCtlAction(theControl, actionProc) SetControlAction(theControl, actionProc)
  637. #define GetCtlAction(theControl) GetControlAction(theControl)
  638. #define SetCtlColor(theControl, newColorTable) SetControlColor(theControl, newColorTable)
  639. #define GetCVariant(theControl) GetControlVariant(theControl)
  640. #define getctitle(theControl, title) getcontroltitle(theControl, title)
  641. #define setctitle(theControl, title) setcontroltitle(theControl, title)
  642. #endif
  643. /*
  644. *****************************************************************************
  645. *                                                                           *
  646. * The conditional STRICT_CONTROLS has been removed from this interface file.*
  647. * The accessor macros to a ControlRecord are no longer necessary.           *
  648. *                                                                           *
  649. *****************************************************************************
  650.  
  651. Details:
  652. The original purpose of the STRICT_ conditionals and accessor macros was to
  653. help ease the transition to Copland.   Shared data structures are difficult
  654. to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  655. WindowRecord and other data structures, we would begin the migration to 
  656. system data structures being completely hidden from applications. 
  657.  
  658. After many design reviews, it was finally concluded that with this sort of
  659. migration, the system could never tell when an application was no longer 
  660. peeking at a WindowRecord, and thus the data structure might never become 
  661. system owned.  Additionally, there were many other limitations in the classic
  662. toolbox that were begging to be addressed.
  663.  
  664. The final decision was to leave the traditional toolbox as a compatibility mode.
  665. The preferred toolbox API for Copland is a new SOM(tm) based architecture 
  666. (e.g. HIWindows.idl).  Windows, menu, controls, etc are each a SOM object 
  667. with methods for drawing, event handling, and customization.
  668.  
  669. */
  670. #define GetControlListFromWindow(theWindow)        ( *(ControlRef *) (((UInt8 *) theWindow) + sizeof(GrafPort) + 0x20))
  671. #define GetControlOwningWindowControlList(theWindowRef)        ( *(ControlRef *) (((UInt8 *) theWindowRef) + sizeof(GrafPort) + 0x20))
  672. #endif
  673.  
  674. #if PRAGMA_ALIGN_SUPPORTED
  675. #pragma options align=reset
  676. #endif
  677.  
  678. #if PRAGMA_IMPORT_SUPPORTED
  679. #pragma import off
  680. #endif
  681.  
  682. #ifdef __cplusplus
  683. }
  684. #endif
  685.  
  686. #endif /* __CONTROLS__ */
  687.  
  688.